package com.yishusmt.mobsmt.utils;

import com.yishusmt.mobsmt.controller.WebSocketController;

import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @author zhangyi
 * @date 2018/8/8 15:07
 */
public class WebSocketMapUtil {
    public static ConcurrentMap<String, WebSocketController> webSocketMap = new ConcurrentHashMap<>();

    public static void put(String key, WebSocketController myWebSocket) {
        webSocketMap.put(key, myWebSocket);
    }

    public static WebSocketController get(String key) {
        return webSocketMap.get(key);
    }

    public static void remove(String key) {
        webSocketMap.remove(key);
    }

    public static Collection<WebSocketController> getValues() {
        return webSocketMap.values();
    }
}
